
      //const url = "https://image.baidu.com/search/acjson?tn=resultjson_com&ipn=rj&ct=201326592&is=&fp=result&queryWord=%E7%9F%B3%E5%8E%9F%E9%87%8C%E7%BE%8E&cl=2&lm=-1&ie=utf-8&oe=utf-8&adpicid=&st=-1&z=&ic=0&hd=1&latest=&copyright=&word=%E7%9F%B3%E5%8E%9F%E9%87%8C%E7%BE%8E&s=&se=&tab=&width=&height=&face=0&istype=2&qc=&nc=1&fr=&expermode=&force=&pn=30&rn=30&gsm=1e&1565319711348=";
      const url = "http://img.btu.pp.ua/random/api.php?type=json";//"https://api.loli.bj/api/?type=json";
      //const url_xg = "http://img.btu.pp.ua/random/api.php?type=json";
    new Vue({
    el: '#mn',
    data: function() {
      return {
          user:{
            nickname: "游客",
            avatar: "http://hnnyjg.com/upload/ZyPicture/1629822686289.png"
          },
           visible: false,
          mv:'./ssyy.jpg',
          refreshTime: 2000,
          mvList: [],
          autoPlay: false,
          isPlay: false,
          interval: null,
          mnConfig:{
            url:"",year:"",month:"",hour:"",no:"",geshi:"",final_url:"",
            ran_year_max:5,ran_month_max:12,ran_hour_max:24,ran_no_max:12,img_name:""
          },
       }
    },
    methods: {
      // 组织美女链接
        getMnUrl(){
          return getConfig().then(res=>{
            var mn = this.mnConfig;
            this.mnConfig = {...mn, ...res.data.mn};
            console.log(this.mnConfig);
            var __year = new Number(this.mnConfig.year) +  Math.floor(Math.random() * this.mnConfig.ran_year_max);
            var __month = new Number(this.mnConfig.month) +  Math.floor(Math.random() * this.mnConfig.ran_month_max);
            var __hour = new Number(this.mnConfig.hour) +  Math.floor(Math.random() * this.mnConfig.ran_hour_max);
            var __no = new Number(this.mnConfig.no) +  Math.floor(Math.random() * this.mnConfig.ran_no_max);
            if(__month<10) __month = "0" + __month;
            if(__hour<10) __hour = "0" + __hour;
            if(__no<10) __no = "0" + __no;
            //https://imgpc.iimzt.com/2016/04/02a01.jpg
            this.mnConfig.img_name = __hour + "a" + __no + this.mnConfig.geshi;
            this.mnConfig.final_url = this.mnConfig.url + __year + "/" + __month + "/" + __hour + "a" + __no + this.mnConfig.geshi;
            var me = this;
          })
        },
         getMv(){
            this.getMnUrl().then(res=>{
                window.downloadImg(this.mnConfig.final_url,this.mnConfig.img_name,(ee)=>{
                    console.log("eee",ee)
                    var data =  window.readImg(this.mnConfig.img_name);
                    var base64Image = data.toString('base64');
                    this.mv = "data:image/jpg;base64," + base64Image;
                });
            });
        //    var data =  window.readImg();
        //    var base64Image = data.toString('base64')
        //     // console.log(base64Image);
        //     this.mv = "data:image/jpg;base64," + base64Image;
          // axios.post(url,{}).then(res=>{
          //     console.log("res",res);
          // })
          // axios.defaults.baseURL = 'https://api.example.com';


        //  axios.defaults.headers.common['Referer22'] = "https://www.mzitu.com/";
        // axios.defaults.headers.post['Content-Type'] = 'application/x-www-form-urlencoded';
        //   this.mv = this.mnConfig.final_url;
        //   axios({
        //     headers: {
        //         'Referer': 'www.mzitu.com/'
        //     },
        //     responseType:'stream',
        //     method: 'post',
        //     url: BIRD + "https://bird.ioliu.cn/v2?url=https://imgpc.iimzt.com/2018/09/16a11.jpg",
        // }).then(res=>{
        //     console.log(res);
        //   })
        },
        play(){
          this.autoPlay = !this.autoPlay;
          this.isPlay = !this.isPlay;
          if(!this.autoPlay){
            if(this.interval)clearInterval(this.interval);
          }else{
            // 自动获取
            this.interval = setInterval(()=>{
                this.getMv();
            },this.refreshTime)
          }
        },
        zoom(e){
          // console.log(e);
          layer.open({
            title: "",
            type: 2,
            content: e.target.src,
            area:['100%','100%']
          })
        },
    },
    created() {
    },
    mounted() {
      // if(this.autoPlay) this.play();
      // var u = window.getUser();
      // if(u) this.user = u;
      // console.log(this.user)
    },
  })